package com.example.test3.Bean;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import java.util.Objects;

@Data
@Getter
@Setter
public class RegionStats {


    private String state;           //省
    private String country;         //国家
    private int latestTotalCases;   //总确诊数
    private int diffFromPrevDay;    //每天新增

    public RegionStats(String state, String country, int latestTotalCases, int diffFromPrevDay) {
        this.state = state;
        this.country = country;
        this.latestTotalCases = latestTotalCases;
        this.diffFromPrevDay = diffFromPrevDay;
    }

    public RegionStats() {
    }

    public String getState() {

        return state;
    }
    public String getCountry() {

        return country;
    }

    public int getLatestTotalCases() {
        return latestTotalCases;
    }

    public int getDiffFromPrevDay() {

        return diffFromPrevDay;
    }
    public void setState(String state) {

        this.state = state;
    }

    public void setCountry(String country) {

        this.country = country;
    }

    public void setLatestTotalCases(int latestTotalCases) {
        this.latestTotalCases = latestTotalCases;
    }

    public void setDiffFromPrevDay(int diffFromPrevDay) {
        this.diffFromPrevDay = diffFromPrevDay;
    }


    @Override
    public String toString() {
        return "RegionStats{" +
                "state='" + state + '\'' +
                ", country='" + country + '\'' +
                ", latestTotalCases=" + latestTotalCases +
                ", diffFromPrevDay=" + diffFromPrevDay +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        RegionStats that = (RegionStats) o;
        return Objects.equals(state, that.state) &&
                Objects.equals(country, that.country);
    }

}
